
const api = {
    // 轮播图
    banner:'/shop_backend/banner/',
    // 商品
    goods:'/shop_backend/goods/',
    // 图片上传
    upload:'/mdw_backend/upload/',
    // 优惠券
    coupon:'/shop_backend/coupon/',
    // 订单管理
    order:'/shop_backend/order/',
    login:'/shop_backend/login/',
    search:'/shop_backend/search/',
    goodsList:'/shop_backend/info/',
    // 运费
    carriage:'/shop_backend/carriage/',
    // 修改规格
    spec:'/shop_backend/spec/'
}
let apiObj = Object.assign(api)
var baseUrl
function getApi () {
    if (process.env.NODE_ENV === 'development') {
        // baseUrl = 'http://192.168.3.188:8086' // (开发端口)
        baseUrl = 'http://120.77.237.245:8002' 
    }else {
        baseUrl = 'http://120.77.237.245:8002' //   (生产端口)
    }
    for (const key in apiObj) {
        apiObj[key] = baseUrl + apiObj[key]
    }
    return apiObj
}
getApi()
export {apiObj,baseUrl}